<?php

/**
 * Input7dForecastProvince form base class.
 *
 * @method Input7dForecastProvince getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseInput7dForecastProvinceForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'DTTIME_FORECAST'   => new sfWidgetFormInputHidden(),
      'IPROVINCE_ID'      => new sfWidgetFormInputHidden(),
      'DTSAVE_TIME'       => new sfWidgetFormDateTime(),
      'IUSER_ID'          => new sfWidgetFormInputText(),
      'ITEMPERATURE_MAX'  => new sfWidgetFormInputText(),
      'ITEMPERATURE_MIN'  => new sfWidgetFormInputText(),
      'IWIND_DIRECTION'   => new sfWidgetFormInputText(),
      'IWIND_SPEED'       => new sfWidgetFormInputText(),
      'IRAIN_AREA'        => new sfWidgetFormInputText(),
      'SDESC_TH'          => new sfWidgetFormTextarea(),
      'SDESC_ENG'         => new sfWidgetFormTextarea(),
      'IWEATHER_TYPE'     => new sfWidgetFormInputText(),
      'ITEMPERATURE_TYPE' => new sfWidgetFormInputText(),
      'IWAVE_TYPE'        => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'DTTIME_FORECAST'   => new sfValidatorChoice(array('choices' => array($this->getObject()->getDttimeForecast()), 'empty_value' => $this->getObject()->getDttimeForecast(), 'required' => false)),
      'IPROVINCE_ID'      => new sfValidatorChoice(array('choices' => array($this->getObject()->getIprovinceId()), 'empty_value' => $this->getObject()->getIprovinceId(), 'required' => false)),
      'DTSAVE_TIME'       => new sfValidatorDateTime(),
      'IUSER_ID'          => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'ITEMPERATURE_MAX'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ITEMPERATURE_MIN'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IWIND_DIRECTION'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IWIND_SPEED'       => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IRAIN_AREA'        => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SDESC_TH'          => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SDESC_ENG'         => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'IWEATHER_TYPE'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ITEMPERATURE_TYPE' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IWAVE_TYPE'        => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('input7d_forecast_province[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Input7dForecastProvince';
  }


}
